package edu.faytechcc.csc251.elementalTD;

import java.awt.*;
import java.util.ArrayList;

/**
 * 10/10/2013 CIS 251
 *
 * @author William Robles
 */
public class Map
{
    public static int worldWidth = 14;
    public static int worldHeight = 15;
    public static int blockSize = 24;
    
    public Block[][] block;
    
    public Map()
    {
        define();
    }
    
    /**
     * define method defines how big both levels of the map area are and
     * the tile that is used
     */
    public void define()
    {
        block = new Block[worldHeight][worldWidth];
        
        for(int y = 0;y < block.length;y++)
        {
            for(int x = 0;x < block[0].length;x++)
            {
                block[y][x] = new Block(8 +(x * blockSize),30 +(y * blockSize), blockSize,
                        blockSize , GameDisplay.groundGrass);
            }
        }
    }
    
    /**
     * physics method links to block class method physics to determine
     * when to attack
     * @param mobs
     */
    public void physics(ArrayList<Mob> mobs)
    {
//        for (Block[] block1 : block)
//        {
//            for (int x = 0; x < block[0].length; x++)
//            {
//                block1[x].physics(mobs);
//            }
//        }
    }    
    
    /**
     * draw method draws the defined block with its y and x coordinate and
     * links to block class towerAttack method
     *  
     * @param g 
     */
    public void draw(Graphics g)
    {
        for(int y = 0;y < block.length;y++)
        {
            for(int x = 0;x < block[0].length;x++)
            {
                block[y][x].draw(g);
            }
        }
        
//        for(int y = 0;y < block.length;y++)
//        {
//            for(int x = 0;x < block[0].length;x++)
//            {
//                block[y][x].towerAttack(g);
//            }
//        }
    }
    
}
